import { baseURL } from "@/axiosConfig"
import { Box, HStack, Heading,Image,Text } from "@chakra-ui/react"
import axios from "axios"
import { MdMovie } from "react-icons/md"
export default function Movie({data,title}) { 
    return <Box maxW={1200} mx="auto" mt="20px">
       <HStack fontSize={"24px"}>
         <MdMovie></MdMovie>
         <Heading as="h3" fontSize={"24px"}>电影</Heading>
       </HStack>
       <HStack mt="20px" spacing={3}>
        {data.map(movie=>{
            return <Box w={"290px"} key={movie.id}>
            <Image src={movie.url}></Image>
            <Text mt="10px">{movie.title}</Text>
        </Box>
        })}
       </HStack>

    </Box>
 }

 export function loadMove(){
    return axios.get(`${baseURL}/api/movie`,{baseURL})
 }

